#include "graph.hpp"

int main()
{
    Graph graph;

    // 添加节点和边
    graph.addNode('A', 0);
    graph.addNode('B', 1);
    graph.addNode('C', 2);
    graph.addNode('D', 3);
    graph.addNode('E', 4);
    graph.addNode('F', 5);
    graph.addNode('G', 6);

    graph.addEdge('A', 'G');
    graph.addEdge('A', 'F');
    graph.addEdge('B', 'G');
    graph.addEdge('B', 'C');
    graph.addEdge('E', 'C');
    graph.addEdge('E', 'F');
    graph.addEdge('G', 'F');
    graph.addEdge('E', 'D');
    graph.addEdge('G', 'D');

    // 绘制邻接矩阵
    graph.printAdjacencyMatrix();

    // 统计边的数量并展示所有边
    graph.printEdges();

    // 广度优先遍历
    graph.BFS('A');
    graph.breadthFirstSearch('A', 'D');

    cout << "----------------------------" << endl;
    // 深度优先遍历
    graph.DFS('A');

    // 查找
    graph.startDFS('A', 'D');
    cout << "----------------------------" << endl;
    graph.displayAllPaths('A', 'D');
    return 0;
}